package com.app.net.common;

import com.app.net.req.BaseReq;
import com.app.utiles.other.DLog;
import com.retrofits.net.common.BaseNetSource;
import com.retrofits.net.common.RequestBack;
import com.retrofits.net.manager.BaseManager;
import com.retrofits.net.utiles.RLog;

import retrofit2.Retrofit;

/**
 * Created by javacoder on 2016/10/19.
 */

public abstract class AbstractBaseManager extends BaseManager {
    protected BaseReq baseReq;

    public AbstractBaseManager(RequestBack requestBack) {
        super(requestBack);
        init();
        RLog.DBUG = DLog.DBUG;
    }

    protected void setBaseReq(BaseReq baseReq) {
        this.baseReq = baseReq;
    }

    public void doRequest() {
        doRequest("");
    }

    public void doRequest(String other) {
        Retrofit retrofit = BaseNetSource.getInstance().getRetrofit(new UrlManger());
        request(retrofit, other);
    }



    protected abstract void init();

    protected abstract void request(Retrofit retrofit, String other);


}
